#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["StartsEAS_API/StartsEAS_API.csproj", "StartsEAS_API/"]
COPY ["StartsEAS_API.BLL/StartsEAS_API.BLL.csproj", "StartsEAS_API.BLL/"]
COPY ["StartsEAS_API.DAL/StartsEAS_API.DAL.csproj", "StartsEAS_API.DAL/"]
COPY ["StartEAS_API.Utils/StartEAS_API.Utils.csproj", "StartEAS_API.Utils/"]
COPY ["StartsEAS_API.Model/StartsEAS_API.Model.csproj", "StartsEAS_API.Model/"]
RUN dotnet restore "StartsEAS_API/StartsEAS_API.csproj"
COPY . .
WORKDIR "/src/StartsEAS_API"
RUN dotnet build "StartsEAS_API.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "StartsEAS_API.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "StartsEAS_API.dll"]